Table of Contents
What is a Collaboration Service?
PageProcessorComponent of Sample Collaboration Service
DynPage of Sample Collaboration Service
Configuration of the Collaboration Services
Configurables of Type LinkCommand
A Collaboration Service is a service that can be launched to collaborate with a single person or a group of people. Examples for such services are Send Email, Share Application or Dial Phone.
In the Knowledge Management & Collaboration applications Collaboration Services are available in the Collaboration Launch Pad or Team Member List and
wherever a user or a group is displayed using the so-called PeopleRenderer control. A portal user can access and launch the services via the
respective context menus.
It is possible to write your own Collaboration Service and make it available via configuration.
When an application like the Collaboration Launch Pad or a PeopleRenderer control launches a Collaboration Service they create a container and
put the respective users or groups into it. On launch of the Collaboration Service the service retrieves the users or groups from the container and uses them
in its application logic.
From a technical point of view a Collaboration Service is a portal component which makes use of the so-called ContextContainer. The
ContextContainer carries the list of people involved in Collaboration Service's action.
In the following chapter the implementation of a Collaboration Service sample is shown.
The portal component implementing the Collaboration Service is a usually a HTMLB DynPage application. Therefore we have to implement two
classes: the PageProcessorComponent and the DynPage.
As in most cases the PageProcessorComponent implementation only returns the DynPage:
package sample.collaborationservice;import com.sapportals.htmlb.page.DynPage;import com.sapportals.portal.htmlb.page.PageProcessorComponent;public class SampleCollaborationService extends PageProcessorComponent {public DynPage getPage() {return new SampleCollaborationServicePage();}}
Below you can find the source of the DynPage. All important lines will be explained in more details later on.
package sample.collaborationservice;import java.util.ArrayList;import com.sap.netweaver.kmc.people.shared.ctx.ContextContainer;import com.sapportals.htmlb.page.DynPage;import com.sapportals.htmlb.page.PageException;import com.sapportals.htmlb.rendering.IPageContext;import com.sapportals.portal.prt.component.IPortalComponentRequest;public class SampleCollaborationServicePage extends DynPage {public void doProcessBeforeOutput() throws PageException {IPageContext pc = getPageContext();IPortalComponentRequest request = (IPortalComponentRequest)pc.getRequest();// Use the PortalComponentRequest to create the ContextContainer.ContextContainer container = new ContextContainer(request);try {// Retrieve flat list of UniqueIds of PrincipalsArrayList peopleIdList = container.getResolvedPeopleList();// @TODO put your application logic here} catch (Exception e) {throw new PageException(e);}}public void doInitialization() throws PageException {}public void doProcessAfterInput() throws PageException {}}
In order to work with the principals (users, groups, roles) provided by either the Collaboration Launch Pad or the PeopleRenderer, you need to
instantiate a ContextContainer.
You can then call the methods on the ContextContainer to get an ArrayList which contains all principals. See Javadoc for
details.
In this chapter you can find the steps that are necessary to create the Configurables for your Collaboration Service.
See also the Collaboration Services documentation [ColService Doc] for details on how to reference the Configurables in the
configuration.
The Configurables must be deployed to the configuration path "Collaboration - Properties - LinkCommand ".
For each Collaboration Service you need to create two Configurables of type LinkCommand.
The Configurables only differ in the underlying Java implementation that is used:
|
Usage |
Java Implementation Class |
|
|
|
|
Team Member List |
|
Note: even if your Collaboration Service can only deal with a single user, you should create two Configurables because otherwise the
Collaboration service cannot be launched for single users that were selected in the Collaboration Launch Pad.
In the table below you can see all attributes of a LinkCommand Configurable:
|
Attribute |
Description of Value or Sample Value |
Fixed or Custom |
|
javaClass |
|
|
|
reference |
|
|
|
resourceBundle |
|
|
|
labelKey |
|
|
|
tooltipKey |
|
|
|
positionType |
|
|
|
height, width |
|
|
|
top, left |
|
|
|
valueFactoryKey |
LinkCommandValueFactory |
|
|
launchType |
modalPopup |
|
|
ridPathName |
|
|
|
windowName |
|
|
|
applicationParameters |
|
|
|
urlParameters |
|
|
|
portalRoles |
|
|
The last column specifies whether the attribute should be changed or not.
Find below a full example for a LinkCommand Configurable:
<?xml version="1.0" encoding="UTF-8" ?>
<Configurable configclass="LinkCommand">
<property name="name" value="MyCollaborationService"/>
<property name="javaClass"
value="com.sap.netweaver.coll.coreui.api.uicommands.UILaunchCommand"/>
<property name="reference"
value="portal:sample.portal.app.CollaborationService"/>
<property name="resourceBundle" value="sample.collaborationservice.MyBundle"/>
<property name="labelKey" value="XLAB_COLL_SERVICE"/>
<property name="tooltipKey" value="XTOL_COLL_SERVICE"/>
<property name="positionType" value="custom"/>
<property name="height" value="340"/>
<property name="width" value="200"/>
<property name="top" value="20"/>
<property name="left" value="20"/>
<property name="valueFactoryKey" value="LinkCommandValueFactory"/>
<property name="launchType" value="modalPopup"/>
<property name="ridPathName" value="Uri"/>
<property name="windowName" />
<property name="applicationParameters" />
<property name="urlParameters" />
<property name="portalRoles" />
</Configurable>
The attribute values in bold are the ones which will differ in your configurable.
Note: You must adhere to the naming conventions for Configurable files names. See [Config Fwk] for details.
The context menu entry of your Collaboration Service can be internationalised by using standard Java technology.
Therefore you need to add two properties for the label and the tool tip of the Collaboration Service in a resource bundle.
These properties are referenced in the Configurable as described in the previous chapter.
Note: The resource bundle files need to be registered with the CRT. For a detailed description see [RF CRT Config].
[ColService Doc]: See chapter "Collaboration Services" and here "Configuration" in the EP standard documentation.
[RF CRT Config]: See chapter "Config Handling" in the Repository Framework chapter "How to use RF's Repository Services".
[Config Fwk]: See chapter "Config Framework" in KMC_Documentation_Eclipse